package com.huike.pmps.model.entity;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.fasterxml.jackson.annotation.JsonFormat;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;

import java.math.BigDecimal;
import java.util.Date;

/**
 * 作者：谌贵斌(黑桃K)
 * 日期: 2888-08-08
 * 老师QQ: 272488352
 * 官方QQ交流群: 377748272
 * 刀客程序员官网：http://www.daoke360.com
 * 刀客程序员淘宝旗舰店：https://daoke360.taobao.com/
 */
@Data
@Builder
@NoArgsConstructor
@AllArgsConstructor
@TableName("p_po")
public class PO {
    @TableId(value = "id", type = IdType.AUTO)
    private Integer id;
    @ApiModelProperty("po单号")
    private String po;
    @ApiModelProperty("po负责人ID")
    private Integer poChargeId;
    @ApiModelProperty("po负责人名称")
    private String poChargeName;
    @ApiModelProperty("产品类型ID")
    private Integer productTypeId;
    @ApiModelProperty("产品类型名称")
    private String productTypeName;
    @ApiModelProperty("战区ID")
    private Integer regionId;
    @ApiModelProperty("战区名字")
    private String regionName;
    @ApiModelProperty("省份ID")
    private Integer provinceId;
    @ApiModelProperty("省份名字")
    private String provinceName;
    @ApiModelProperty("合同编号")
    private String contractNo;
    @ApiModelProperty("合同类型ID")
    private Integer contractTypeId;
    @ApiModelProperty("合同类型名称")
    private String contractTypeName;
    @ApiModelProperty("客户名称")
    private String customerName;
    @ApiModelProperty("合同金额")
    private BigDecimal contractAmount;
    @ApiModelProperty("合同申请人")
    private String contractApplicant;
    @ApiModelProperty("合同交付日期")
    private Date contractDeliveryDate;
    @ApiModelProperty("合同总时长")
    private Integer contractTotalTimeLength;
    @ApiModelProperty("合同已完成时长")
    private Integer contractFinishedTimeLength;
    @ApiModelProperty("合同未完成时长")
    private Integer contractUnfinishedTimeLength;
    @ApiModelProperty("合同已回款金额")
    private BigDecimal contractPaymentReceived;
    @ApiModelProperty("合同未回款金额")
    private BigDecimal contractOutstandingPayment;
    @ApiModelProperty("版权归属")
    private String copyrightOwnership;
    @ApiModelProperty("版权费用")
    private BigDecimal copyrightFee;
    @ApiModelProperty("商务杂费")
    private BigDecimal businessSundryFee;
    @ApiModelProperty("合同第三方采购金额")
    private BigDecimal contractPurchaseAmount;
    @ApiModelProperty("合同毛利")
    private BigDecimal contractGrossProfit;
    @ApiModelProperty("预测毛利率")
    private String forecastGrossProfitRate;
    @ApiModelProperty("预估生成成本")
    private BigDecimal estimatedGenerationCost;
    @ApiModelProperty("约定售后期限")
    private Date afterSalePeriod;
    @ApiModelProperty(value = "记录状态", hidden = true)
    private Integer state;
    @ApiModelProperty("po状态(1进行中、2已完成、3已过期)")
    private Integer poState;
    @ApiModelProperty("导入标记(1导入新合同,2导入po数据)")
    private Integer importFlag;
    @ApiModelProperty("po备注")
    private String poRemark;
    @ApiModelProperty("编辑状态（false or true）")
    private Boolean rowEdit;
    @ApiModelProperty(value = "记录更新时间", hidden = true)
    //@JsonFormat(shape = JsonFormat.Shape.STRING, pattern = "yyyy-MM-dd HH:mm:ss")
    public Date updateTime;
    @ApiModelProperty("记录创建时间")
    private Date createTime;
    /**
     * add by zcw 2021-01-27: 新增 风险计提(金额) 风险利率(字符串) 渠道费用(金额) 产学合作费(金额) 其他(字符串)
     */
    @ApiModelProperty("风险计提")
    private BigDecimal riskProvision;
    @ApiModelProperty("风险利率")
    private String riskRate;
    @ApiModelProperty("渠道费用")
    private BigDecimal channelFee;
    @ApiModelProperty("产学合作费")
    private BigDecimal industryAndUniversityCooperationFee;
    @ApiModelProperty("其他")
    private String other;

    /**
     * add by zcw 2021-01-27 新增 预估金额 未支付 已支付
     */
    @ApiModelProperty(value = "预估金额",hidden = true)
    @TableField(exist = false)
    @Builder.Default
    private BigDecimal estimatedGenerationCostSum = BigDecimal.valueOf(0.00);

    @ApiModelProperty(value="已支付",hidden = true)
    @TableField(exist = false)
    @Builder.Default
    private BigDecimal paidAmountSum = BigDecimal.valueOf(0.00);

    @ApiModelProperty(value = "未支付",hidden = true)
    @TableField(exist = false)
    @Builder.Default
    private BigDecimal unpaidAmountSum = BigDecimal.valueOf(0.00);

    /**
     * add by zcw 2021-06-30 新增 客户成功ID 客户成功名称
     */
    @ApiModelProperty("客户成功ID")
    private Integer teamId;
    @ApiModelProperty("客户成功名称")
    private String teamName;
}
